package com.cropdoctor.model.vo;

import com.alibaba.druid.filter.AutoLoad;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PostVO {
    @TableId(type= IdType.AUTO)
    private long id;
    private String avatarUrl;
    @ApiModelProperty(value = "帖子标题",required = true,example = "求助,我的西瓜怎么了?")
    private String title;
    @ApiModelProperty(value = "创建时间",required = true,example = "2024:2:14:10:54:27")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;
    private String url;
}
